CUDA_VISIBLE_DEVICES=0 \
polygraphy run /cv/lyh/trt_models/tensorrt_dsgn2/model/dsgn_r50_2d_bn2_bev.onnx \
    --onnxrt --trt \
    --save-outputs ./profile/dsgn_r50_2d_bn2_bev.json\
    --onnx-outputs mark all \
    --trt-outputs mark all\
    --atol 1e-3 --rtol 1e-3 \
    --verbose \
    --fail-fast \
    > /cv/lyh/trt_models/tensorrt_dsgn2/profile/dsgn_r50_2d_bn2_bev.log 2>&1
    # --load-inputs input.json \
    # --fp16 \
    # --save-engine dsgn_backbone_fp32.engine \


# polygraphy run /data/test_lyh/tensorrt_dsgn2/model/dsgn_backbone.onnx \
#     --trt \
#     --load-inputs input.json \
#     --trt-outputs mark all\
#     --save-engine dsgn_backbone_fp32.engine \
#     --verbose \
#     > /data/test_lyh/tensorrt_dsgn2/profile/backbone_fp32_outs.log 2>&1

# polygraphy run /cv/lyh/trt_models/tensorrt_dsgn2/model/dsgn_r50_2d_avg_fp32.engine \
#         --plugins '/cv/lyh/trt_models/tensorrt_dsgn2/plugins/libCostVolumePlugin.so' '/cv/lyh/trt_models/tensorrt_dsgn2/plugins/libDeformConvPlugin.so' '/cv/lyh/trt_models/tensorrt_dsgn2/plugins/libGridSamplePlugin.so' \
#         --trt \
#         --save-inputs input.json \
#         --verbose

# polygraphy convert /cv/lyh/trt_models/tensorrt_dsgn2/model/dsgn2_cnn2d_no2dhead.onnx \
#         --plugins '/cv/lyh/trt_models/tensorrt_dsgn2/plugins/libCostVolumePlugin.so' '/cv/lyh/trt_models/tensorrt_dsgn2/plugins/libDeformConvPlugin.so' '/cv/lyh/trt_models/tensorrt_dsgn2/plugins/libGridSamplePlugin.so' \
#         -o debug_32.engine \
#         --trt-outputs mark all \
#         > /cv/lyh/trt_models/tensorrt_dsgn2/profile/debug_32_engine.log 2>&1 \

# polygraphy convert /cv/lyh/trt_models/tensorrt_dsgn2/model/dsgn2_cnn2d_no2dhead_fp16_modified.onnx \
#         --plugins '/cv/lyh/trt_models/tensorrt_dsgn2/plugins/libCostVolumePlugin.so' '/cv/lyh/trt_models/tensorrt_dsgn2/plugins/libDeformConvPlugin.so' '/cv/lyh/trt_models/tensorrt_dsgn2/plugins/libGridSamplePlugin.so' \
#         -o debug_16.engine \
#         --fp16 \
#         --trt-outputs mark all \
#         > /cv/lyh/trt_models/tensorrt_dsgn2/profile/debug_16_engine.log 2>&1 \

# polygraphy run debug_32.engine\
#         --plugins '/cv/lyh/trt_models/tensorrt_dsgn2/plugins/libCostVolumePlugin.so' '/cv/lyh/trt_models/tensorrt_dsgn2/plugins/libDeformConvPlugin.so' '/cv/lyh/trt_models/tensorrt_dsgn2/plugins/libGridSamplePlugin.so' \
#         --trt \
#         --load-inputs input.json \
#         --trt-outputs mark all \
#         --save-outputs ./profile/debug_32.json \
#         > /cv/lyh/trt_models/tensorrt_dsgn2/profile/debug_32.log 2>&1 \

# polygraphy run /cv/lyh/trt_models/tensorrt_dsgn2/model/debug_16.engine \
#         --plugins '/cv/lyh/trt_models/tensorrt_dsgn2/plugins/libCostVolumePlugin.so' '/cv/lyh/trt_models/tensorrt_dsgn2/plugins/libDeformConvPlugin.so' '/cv/lyh/trt_models/tensorrt_dsgn2/plugins/libGridSamplePlugin.so' \
#         --trt \
#         --fp16 \
#         --load-inputs input.json \
#         --trt-outputs mark all \
#         --save-outputs ./profile/debug_16.json \
#         --load-outputs ./profile/debug_32.json \
#         --atol 1e-3 --rtol 1e-3 \
#         --fail-fast \
#         > /cv/lyh/trt_models/tensorrt_dsgn2/profile/debug_fp32_16_compare.log 2>&1 \


# polygraphy inspect model /cv/lyh/trt_models/tensorrt_dsgn2/model/dsgn2_cnn2d_no2dhead_fp32.engine \
#         --plugins '/cv/lyh/trt_models/tensorrt_dsgn2/plugins/libCostVolumePlugin.so' '/cv/lyh/trt_models/tensorrt_dsgn2/plugins/libDeformConvPlugin.so' '/cv/lyh/trt_models/tensorrt_dsgn2/plugins/libGridSamplePlugin.so' \
#         --verbose --show layers weights \
        # > /cv/lyh/trt_models/tensorrt_dsgn2/profile/engine_1.log 2>&1
